package com.yuyou.tas.report.mapper;

import com.yuyou.tas.report.vo.resp.QuesAvgByHardVo;
import com.yuyou.tas.service.api.report.dto.ReportKnowDTO;
import com.yuyou.tas.service.api.report.dto.ReportQuesDTO;
import com.yuyou.tas.service.api.report.dto.ReportStudentDTO;
import com.yuyou.tas.service.api.report.entity.ExamModelComment;
import com.yuyou.tas.service.api.report.vo.QuesResultVo;
import com.yuyou.tas.util.bean.Pagination;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface StudentReportMapper {

	/**
	 * 学生报告列表分页
	 * @param queryPgn
	 * @return
	 */
    int findReportStudentCount(Pagination<ReportStudentDTO> queryPgn);
   
    /**
     * 学生报告列表总数
     * @param queryPgn
     * @return
     */
    List<ReportStudentDTO> findReportStudentPageList(Pagination<ReportStudentDTO> queryPgn);

    /**
     * 01总体概况
     * @param examModelReportId
     * @return
     */
    ReportStudentDTO reportInfo(
    		@Param(value="examModelReportId") Long examModelReportId);
    
    /**
     * 总体概况排名
     * @param examModelReportId
     * @return
     */
    Integer reportInfoRank(
    		@Param(value="examModelId") Long examModelId,
    		@Param(value="baseSchoolId") Long baseSchoolId,
    		@Param(value="lessonClassId") Long lessonClassId,
    		@Param(value="getScore") BigDecimal getScore);


    
    /**
     * 02成绩整体情况
     * @param examModelId
     * @param baseSchoolId
     * @param initScore
     * @param endScore
     * @return
     */
    int reportScoreCount(
    		@Param(value="examModelId") Long examModelId,
    		@Param(value="baseSchoolId") Long baseSchoolId,
    		@Param(value="initScore") BigDecimal initScore,
    		@Param(value="endScore") BigDecimal endScore);
	
    /**
     * 获取模板（校区）(班级)平均分
     * @param examModelId
     * @param baseSchoolId
     * @param lessonClassId
     * @return
     */
    BigDecimal reportInfoScore(
    		@Param(value="examModelId") Long examModelId,
    		@Param(value="baseSchoolId") Long baseSchoolId,
    		@Param(value="lessonClassId") Long lessonClassId);
    
    
    /**
     * 03难易度情况
     * @param studentId
     * @param examModelId
     * @param lessonClassId
     * @return
     */
//    ReportHardDTO reportHard(@Param(value="studentId") Long studentId, @Param(value="examModelId") Long examModelId,@Param(value="lessonClassId") Long lessonClassId);
    
    /**
     * 04各试题得分情况
     * @param studentId
     * @param examModelId
     * @param lessonClassId
     * @return
     */
    ReportQuesDTO reportQues(@Param(value="studentId") Long studentId, @Param(value="examModelId") Long examModelId,@Param(value="lessonClassId") Long lessonClassId);
    
    /**
     * 05知识得分情况分析
     * @param studentId
     * @param examModelId
     * @param lessonClassId
     * @return
     */
    List<ReportKnowDTO> reportKnow(@Param(value="studentId") Long studentId, @Param(value="examModelId") Long examModelId,@Param(value="lessonClassId") Long lessonClassId);

    /**
     * 各知识点平均分
     * @param examModelId
     * @return
     */
    List<ReportKnowDTO> avgScoreOfKnow(@Param(value="examModelId") Long examModelId);

    /**
     * 各难度的平均分
     * @param examModelId
     * @return
     */
    List<QuesAvgByHardVo> getAvgByHard(@Param(value="examModelId") Long examModelId);

    /**
     * 各难度的学生平均分
     * @param studentId
     * @param examModelId
     * @param lessonClassId
     * @return
     */
    List<QuesAvgByHardVo> getStuAvgByHard(@Param(value="studentId") Long studentId, @Param(value="examModelId") Long examModelId,@Param(value="lessonClassId") Long lessonClassId);

    /**
     * 学生某试卷下的题目答题结果列表
     * @param studentId
     * @param examModelId
     * @param lessonClassId
     * @return
     */
    List<QuesResultVo> getStuQues(@Param(value="studentId") Long studentId, @Param(value="examModelId") Long examModelId,@Param(value="lessonClassId") Long lessonClassId);


    /**
     * 通过分数、类型、机构、年纪获取评语
     * @param organId
     * @param score
     * @param sectionId
     * @param type
     * @return
     */
    String getCommentByParams(@Param(value="organId") Long organId , @Param(value="score") BigDecimal score ,
                              @Param(value="sectionId") Long sectionId , @Param(value="type") Integer type, @Param(value="style") Integer style);


    List<ExamModelComment> getCommentEntityByParams(@Param(value="organId") Long organId , @Param(value="sectionId") Long sectionId ,
                                                    @Param(value="type") Integer type, @Param(value="style") Integer style);

}
